package com.yindian.cos.easy.security.authentication.login.social.core;

import lombok.Data;

import java.util.Map;

/**
 * 第三方平台的access_token，有部分厂商是open_id和access_token一起返回
 * 如果不是一起返回的则回去到open_id之后需要放回此AccessToken当中供后续流程使用
 *
 * @author zhangchuanhao
 * @create 2018/11/20
 */
@Data
public class AccessToken {

    private String accessToken;

    private String openId;

    /**
     * 其他附带配置，可根据业务自行处理
     */
    private Map<String, Object> others;

    public AccessToken(String accessToken, Map<String, Object> others) {
        this.accessToken = accessToken;
        this.others = others;
    }

    public AccessToken(String accessToken, String openId, Map<String, Object> others) {
        this(accessToken, others);
        this.openId = openId;
    }
}
